import request from "./index.js"
// 查询设备维修记录列表
export function listRepair(query) {
	return request({
		url: '/repair/repair/list',
		method: 'get',
		data: query
	})
}

// 查询设备维修记录详细
export function getRepair(repairId) {
	return request({
		url: '/repair/repair/' + repairId,
		method: 'get'
	})
}

// 新增设备维修记录
export function addRepair(data) {
	return request({
		url: '/repair/repair',
		method: 'post',
		data: data
	})
}

// 修改设备维修记录
export function updateRepair(data) {
	return request({
		url: '/repair/repair',
		method: 'put',
		data: data
	})
}

// 删除设备维修记录
export function delRepair(repairId) {
	return request({
		url: '/repair/repair/' + repairId,
		method: 'delete'
	})
}

// 撤销，维修成功设备维修记录
export function repairEquipment(data) {
	return request({
		url: '/repair/repair/repairEquipment',
		method: 'post',
		data: data
	})
}



// 查询后勤设备列表
export function listEquipment(query) {
	return request({
		url: '/equipment/equipment/list',
		method: 'get',
		data: query
	})
}

// 查询后勤设备详细
export function getEquipment(equipmentId) {
	return request({
		url: '/equipment/equipment/' + equipmentId,
		method: 'get'
	})
}

// 新增后勤设备
export function addEquipment(data) {
	return request({
		url: '/equipment/equipment',
		method: 'post',
		data: data
	})
}

// 修改后勤设备
export function updateEquipment(data) {
	return request({
		url: '/equipment/equipment',
		method: 'put',
		data: data
	})
}

// 删除后勤设备
export function delEquipment(equipmentId) {
	return request({
		url: '/equipment/equipment/' + equipmentId,
		method: 'delete'
	})
}

// 上传图片
export function uploadImg(data) {
	return request({
		url: '/common/upload',
		method: "post",
		header: {
			"Content-Type": "multipart/form-data"
		},
		data
	})
}